from fastapi import Request
from fastapi.templating import Jinja2Templates

templates = Jinja2Templates(directory="./templates")


def view_page(request: Request, filename: str, **kwargs):
    return templates.TemplateResponse(filename, dict(request=request, **kwargs))
